package com.mmall.concurrency.example.singleton;

import com.mmall.concurrency.annotions.ThreadSafes;

/**
 * <p>Descriptions...
 *
 * @author Diamon.Cheng
 * @date 2019/12/5.
 */
@ThreadSafes
public class SingletonExample_5 {
    private  SingletonExample_5(){}
    
    public  static  volatile   SingletonExample_5 instance = null;
    
    public  static   SingletonExample_5  getInstance(){
    
        if (instance ==null){
            synchronized (SingletonExample_5.class){
                if (instance == null){
                    instance = new SingletonExample_5();
                }
            }
        }
        
        return  instance;
    }
    
}
